/**
 * @file TestAvlTree.cpp
 * @author Hu Yumeng (3210103435@zju.edu.cn)
 * @brief AvlTree
 * @version 0.1
 * @date 2022-10-15
 *
 * @copyright Copyright (c) 2022
 *
 */
#include <iostream>
#include <vector>
#include <ctime>
#include "AvlTree.h"
using namespace std;
clock_t start, stop;
double duration, ticks;

// Test program
int main()
{
    AvlTree<int> t;
    vector<int> vec;
    int k1 = 0;
    int k2 = 500;
    for (double i = 0; i < 1000000; i++)
    {
        t.insert(i);
    }
    // t.printTree();

    if (k1 > k2)
    {
        cout << "It is a mistake!" << endl;
    }
    else
    {
        start = clock();
        t.printRange(k1, k2);
        stop = clock();
        duration = ((double)(stop - start)) / CLOCKS_PER_SEC;
        printf("dur = %lf", duration);
    }

    // start = clock();  //records the ticks at the BEGINNING of function call

    // for (int k = 1; k <= 100; k++) {
    //   //  t.BSTSorting(vec, mode);
    // }

    // stop = clock();//records the ticks at the END of function call
    // duration = ((double)(stop - start)) / CLOCKS_PER_SEC;
    // ticks = (double)stop - start;
    // printf("dur = %lf, ticks = %lf", duration, ticks);
    return 0;
}
